#pragma once
#include "igamestate.h"
#include "../AnimationManager.h"
#include "../TileManager.h"
#include "../Tile.h"
#include "../PlatformObst.h"
#include "../Enemies/Enemy.h"
#include "../ObjectFactory.h"
#include "../Player.h"
#include "../Entity.h"
#include "../SGD Wrappers/SGD_String.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../ObjectManager.h"
#include "../MessageSystem.h"
#include "../Message.h"
#include "../ParticleEmitter.h"
#include "../Bitmap Font/BitmapFont.h"
#include "../EventSystem.h"
#include "../NEvent.h"
#include "../SGD Wrappers\CSGD_XAudio2.h"
#include "../Enemies/CSpawnSystem.h"

typedef CObjectFactory< TSTRING, CEntity >	CObjectFact;
class CGameplayState : public IGameState, IListener
{
public:
	CGameplayState(void);
	~CGameplayState(void);
	static CGameplayState* GetInstance(void);
	void Update(float fElapsedTime);
	void Render(void);
	void Enter(void);
	void Exit(void);
	bool Input(void);
	static void MessageProc(InMessage* pMsg);
	void HandleEvent(CNEvent* pEvent);
	struct Camera
	{
		int camPosX;
		int camPosY;
	};
	Camera GetCamera(void)const{return m_pCam;}
private:
	int m_nBackgroundImgID;
	Camera m_pCam;
	void SetCamera(Camera pCam){m_pCam = pCam;}
	CEntity* m_pPlayer;
	CEntity* m_pEnemy;
	CEntity* m_pSpin;

	float m_fPlayerHealthScale;
	float m_fMaxAbilityTime;
	float m_fLifeLossScale;
	int m_nPlayerImgID;
	float spinTimer;
	int m_nLifeBarImgID;
	int m_nLifeBarFrameImgID;
	int m_nHealthCostImgID;
	int m_nSpinButtonImgID;
	int m_nEnemyFlippedImgID;
	int m_nTimerImgID;
	float m_fTimerScale;

	CObjectFact* m_pOF;
	//CTileManager* test;
	CObjectManager* m_pOM;
	CSGD_TextureManager* m_pTM;
	CSGD_DirectInput* m_pDI;
	CSGD_Direct3D* m_pD3D;
	CSGD_XAudio2* m_pXA;
	CAnimationManager*	m_pAM;
	CMessageSystem* m_pMS;
	CEventSystem* m_pES;
	CSpawnSystem* m_pSS;

};